class Solution {
    public:
        int evalRPN(vector<string>& tokens) {
            int i,e;
            stack<long long> ch;
            for(int i = 0; i< tokens.size(); i++){
                if(tokens[i] == "*" || tokens[i] == "/" || tokens[i] == "+" || tokens[i] == "-"){   
                        long long num1 = ch.top();
                            ch.pop();
                                long long num2 = ch.top();
                                    ch.pop();
                                        if(tokens[i] == "*"){
                                                    ch.push(num2 * num1);}
                                                        if(tokens[i] == "/"){
                                                                    ch.push(num2 / num1);}
                                                                        if(tokens[i] == "+"){
                                                                                    ch.push(num2 + num1);}
                                                                                        if(tokens[i] == "-"){
                                                                                                    ch.push(num2 - num1);}
                }
                    else{
                                ch.push(stoll(tokens[i]));
                    }
            }
                e = ch.top();
                    ch.pop();
                        return e;
        }
};